package com.example.mutilinputbuttom;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class MainActivity extends Activity {
    private TextView tv1, tv2;
    private  int numTxt = 7;
    private String[] texts = new String[] { "A", "B", "C" };
    private MutilTextInputButton mutilTextInputButton1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        tv1 = (TextView) findViewById(R.id.tv1);
        tv2 = (TextView) findViewById(R.id.tv2);
        mutilTextInputButton1 = (MutilTextInputButton) findViewById(R.id.mutilTextInputButton1);
        mutilTextInputButton1.setInputTextView(tv1);
        mutilTextInputButton1.setInputArray(texts, numTxt);
        
    }

    public void changeInputMode(View v) {
        int inputmode = mutilTextInputButton1.getInputMode();
        inputmode = inputmode == MutilTextInputButton.INPUTMODE_NUM ? MutilTextInputButton.INPUTMODE_TXT
                : MutilTextInputButton.INPUTMODE_NUM;
        mutilTextInputButton1.setInputMode(inputmode);
    }

    public void doNext(View v) {
        mutilTextInputButton1.setInputTextView(tv2);
    }

}
